package com.sakiko.functioncall.controller;

import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import com.sakiko.functioncall.server.FunctionAssistant;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * projectName: com.sakiko.functioncall.controller
 *
 * @author: sakiko
 * time: 2025/8/29 15:15
 * description:
 */
@RestController
@Slf4j
public class FuntionCallingController {

    @Resource
    FunctionAssistant functionAssistant;

    // http://localhost:9011/function/test1
    @GetMapping("function/test1")
    public String test1() {
        String chat = functionAssistant.chat("开张发票，公司: sakiko 税号: 111111 金额: 666.66");
        System.out.println(chat);
        return "success : " + DateUtil.now() + "\t" + chat;
    }

}
